namespace Oplug.EntityFramework.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<Oplug.EntityFramework.RossLive.OplugLiveDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(Oplug.EntityFramework.RossLive.OplugLiveDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            if (context.RossUsers.Where(o => o.UserName == "admin").Count() <= 0)
            {
                context.RossUsers.AddOrUpdate(
                  new RossLive.RossUsers { UserName = "admin", Password = "123123", UserID = "admin" }
                );
            }
            //
        }
    }
}
